# -*- coding: utf-8 -*-
# @Time : 2019/1/15 9:16
# @Author : yupai
# @File : testrunner.py
# @Project : untitled2
# @title : 糖葫芦串
import HTMLTestRunner
import unittest
import os
# 用例路径
case_path = os.path.join(os.getcwd(), "../testcase/")
# 报告存放路径
report_path = os.path.join(os.getcwd(), "report")
def all_case():
    discover = unittest.defaultTestLoader.discover(case_path,
                                                    pattern="test*.py",
                                                    top_level_dir=None)
    print(discover)
    return discover

if __name__ == "__main__":

    with open("woniuboss接口测试报告.html", "w", encoding="utf8") as file:
        runner = HTMLTestRunner.HTMLTestRunner(stream=file, verbosity=2, title="接口测试报告",
                                               description="接口测试报告")
        runner.run(all_case())
        print(all_case())